<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Wizard.Master" Inherits="System.Web.Mvc.ViewPage" %>

<%@ Import Namespace="System.IO" %>
<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">
    <h1 style="height: 90px; margin: 10px" class="ui-widget-content ui-border-bottom">
        <img style="float: left;" src="<%:Url.Content("~/Content/Images/host/language.png") %>"
            alt="language" /><span style="float: left; padding-top: 20px; padding-left: 5px;"><%:HttpContext.GetGlobalResourceObject("language", "LanguagePack") %></span>
    </h1>
    <div style="clear: left;" />
    <h2>
        <%:HttpContext.GetGlobalResourceObject("language", "LanguagePack_InstalledLanguages")%>
    </h2>
    <div style="margin-bottom: 10px;">
        <p>
            <%:HttpContext.GetGlobalResourceObject("language", "LanugagePack_InstalledLanugages_Title")%></p>
        <p>
            For more language resources and how to create a new language pack you can visit
            our <u><a target="_blank" href="http://www.dotnetage.com/community/forum/index">community</a></u>
        </p>
    </div>
    <div>
        <ul class="ui-helper-reset">
            <%
                var dirs = Directory.GetDirectories(Context.Server.MapPath("~/App_GlobalResources"));
                foreach (var dir in dirs)
                {
                    var d = new DirectoryInfo(dir);
            %>
            <li style="clear: left; margin-bottom: 5px;">
                <h3 style="margin-top: 5px; margin-bottom: 5px;">
                    <a class="ui-state-active" id="<%:d.Name+"Uploader" %>" style="border: none; background: none;
                        font-weight: normal;" href="javascript:void(0);">
                        <%:HttpContext.GetGlobalResourceObject("language", "RES_UPLOAD")%></a>
                    <img src="<%:Url.Content("~/Content/Images/doc_cat.gif") %>" alt="" />
                    <span>
                        <%:d.Name=="language" ? "DotNetAge language packs":d.Name %></span>
                    <% Html.RegisterStartupScript("new AjaxUpload($('#" + d.Name + "Uploader'),{action:'" +
                           Url.Action("UploadLanguage") + "',data:{name:'" +
                           d.Name + "'},onComplete: function (file, response) {$('#" + d.Name + "packs').html(response);} });"); %>
                </h3>
                <div id="<%:d.Name+"packs" %>" style="overflow: auto;">
                    <% Html.RenderAction("Packs", new { name = d.Name }); %>
                </div>
            </li>
            <%} %></ul>
    </div>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="head" runat="server">
    <%:MvcHtmlString.Create(Html.ScriptRef("plugins/ajaxupload.js")) %>
</asp:Content>
